package com.jie.demo1.Sservice.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.jie.demo1.Sservice.FileTypeTableService;
import com.jie.demo1.mapper.FileTypeTableMapper;
import com.jie.demo1.pojo.FileTypeTable;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
* @author 33020
* @description 针对表【file_type_table】的数据库操作Service实现
* @createDate 2024-11-27 21:14:45
*/
@Service
public class FileTypeTableServiceImpl extends ServiceImpl<FileTypeTableMapper, FileTypeTable>
    implements FileTypeTableService{
    @Resource
    private FileTypeTableMapper fileTypeTableMapper;

    @Override
    public FileTypeTable getFileTypeTableById(String contentType) {
        //查询数据库中是否有该文件类型的记录
        LambdaQueryWrapper<FileTypeTable> eqOne = new LambdaQueryWrapper<>();

        eqOne.eq(FileTypeTable::getMimeType,contentType);
        //返回该类型的记录，后续可以在controller中进行判断，获取到该记录的id，然后将该id存入文件信息表中
        return fileTypeTableMapper.selectOne(eqOne);
    }
}




